package com.sg.business.commons.labelprovider.work;

import org.jbpm.task.Status;

import com.sg.business.model.UserTask;
import com.sg.business.resource.nls.Messages;
import com.sg.widgets.commons.labelprovider.ConfiguratorColumnLabelProvider;

public class WorkflowHistoryStatusHtmlLabel extends
		ConfiguratorColumnLabelProvider {

	@Override
	public String getText(Object element) {
		if(element instanceof UserTask){
			UserTask userTask = (UserTask) element;
			String status = userTask.getStatus();
			if (Status.Reserved.name().equals(status)) {
				return Messages.get().UserTask_7;
			} else if (Status.InProgress.name().equals(status)) {
				return Messages.get().UserTask_8;
			} else if (Status.Completed.name().equals(status)) {
				return Messages.get().UserTask_9;
			} else if (Status.Created.name().equals(status)) {
				return Messages.get().UserTask_10;
			} else if (Status.Ready.name().equals(status)) {
				return Messages.get().UserTask_11;
			} else if (Status.Suspended.name().equals(status)) {
				return Messages.get().UserTask_12;
			} else if (Status.Exited.name().equals(status)) {
				return Messages.get().UserTask_13;
			}
		}
		return "";
	}
}
